package com.quentinbeauperin.twitbird
{
	import flash.display.Bitmap;
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.KeyboardEvent;
	import flash.events.MouseEvent;
	
	import mx.core.ButtonAsset;
	
	public class Screen extends Sprite
	{
		private var screen:Bitmap;
		
		public var boutonMenu1:Bouton;
		public var boutonMenu2:Bouton;
		public var boutonMenu3:Bouton;
		public var boutonMenu4:Bouton;
		
		public var boutonGame1:Bouton;
		public var boutonGame2:Bouton;
		public var boutonGame3:Bouton;
		public var boutonGame4:Bouton;
		public var boutonGame5:Bouton;
		
		public var buttonReturn:Bouton;
		public var buttonNext:Bouton;
		
		public var buttonControl1:Bouton;
		public var buttonControl2:Bouton;
		public var buttonStory1:Bouton;
		public var buttonStory2:Bouton;
		
		// Create the screen depending on the specified id, and creates the objects in the stage
		public function Screen(id:int)
		{
			super();
			// Create the menu's screen
			if(id == 1) {
				screen = new Assets.Screen1();
				addChild(screen);
				boutonMenu1 = new Bouton(1);
				addChild(boutonMenu1);
				boutonMenu2 = new Bouton(2);
				addChild(boutonMenu2);
				boutonMenu3 = new Bouton(3);
				addChild(boutonMenu3);
				boutonMenu4 = new Bouton(4);
				addChild(boutonMenu4);
			}
			// Create the level selection's screen
			else if (id == 2) {
				screen = new Assets.Screen2();
				addChild(screen);

				buttonReturn = new Bouton(6)
				addChild(buttonReturn);
				
				boutonGame1 = new Bouton(21);
				addChild(boutonGame1);
				boutonGame2 = new Bouton(22);
				addChild(boutonGame2);
				boutonGame3 = new Bouton(23);
				addChild(boutonGame3);
				boutonGame4 = new Bouton(24);
				addChild(boutonGame4);
				boutonGame5 = new Bouton(25);
				addChild(boutonGame5);
								
			}
			
			// Create the introduction's screen
			else if (id == 3) {
				screen = new Assets.Screen3();
				addChild(screen);
				buttonControl1 = new Bouton(9);
				addChild(buttonControl1);
				buttonControl2 = new Bouton(10);
				buttonStory1 = new Bouton(11);
				buttonStory2 = new Bouton(12);
				addChild(buttonStory2);
				buttonReturn = new Bouton(6);
				addChild(buttonReturn);
			}
			
			// Create the options' screen
			else if (id == 4) {
				screen = new Assets.Screen4();
				addChild(screen);
				buttonReturn = new Bouton(5);
				addChild(buttonReturn);
			}
			
			// Create the credits' screen
			else if (id == 5) {
				screen = new Assets.Screen5();
				addChild(screen);
				buttonReturn = new Bouton(5)
				addChild(buttonReturn);
			}
		}
	}
}